﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace AppManager.Model
{
    /// <summary>
    /// Menu应该可以共享，就是不用区分
    /// </summary>
    public class Sys_Menu : BaseModel
    {
        /// <summary>
        /// 名称
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string Name { get; set; }
        /// <summary>
        /// 链接
        /// </summary>
        [MaxLength(50)]
        public string Link { get; set; }
        /// <summary>
        /// 父级菜单id
        /// </summary>
        public int ParentId { get; set; }

        [NotMapped]
        public IEnumerable<Sys_Menu> Children { get; set; }
        [NotMapped]
        public Sys_Menu Parent { get; set; }
    }
}
